package com.ruoyi.project.wechatprogram.wxtimerlog.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.wechatprogram.wxtimerlog.mapper.WxTimerLogMapper;
import com.ruoyi.project.wechatprogram.wxtimerlog.domain.WxTimerLog;
import com.ruoyi.project.wechatprogram.wxtimerlog.service.IWxTimerLogService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 定时任务执行记录Service业务层处理
 * 
 * @author xinchen
 * @date 2020-05-25
 */
@Service
public class WxTimerLogServiceImpl implements IWxTimerLogService 
{
    @Autowired
    private WxTimerLogMapper wxTimerLogMapper;

    /**
     * 查询定时任务执行记录
     * 
     * @param id 定时任务执行记录ID
     * @return 定时任务执行记录
     */
    @Override
    public WxTimerLog selectWxTimerLogById(Integer id)
    {
        return wxTimerLogMapper.selectWxTimerLogById(id);
    }

    /**
     * 查询定时任务执行记录列表
     * 
     * @param wxTimerLog 定时任务执行记录
     * @return 定时任务执行记录
     */
    @Override
    public List<WxTimerLog> selectWxTimerLogList(WxTimerLog wxTimerLog)
    {
        return wxTimerLogMapper.selectWxTimerLogList(wxTimerLog);
    }

    /**
     * 新增定时任务执行记录
     * 
     * @param wxTimerLog 定时任务执行记录
     * @return 结果
     */
    @Override
    public int insertWxTimerLog(WxTimerLog wxTimerLog)
    {
        wxTimerLog.setCreateTime(DateUtils.getNowDate());
        return wxTimerLogMapper.insertWxTimerLog(wxTimerLog);
    }

    /**
     * 修改定时任务执行记录
     * 
     * @param wxTimerLog 定时任务执行记录
     * @return 结果
     */
    @Override
    public int updateWxTimerLog(WxTimerLog wxTimerLog)
    {
        wxTimerLog.setUpdateTime(DateUtils.getNowDate());
        return wxTimerLogMapper.updateWxTimerLog(wxTimerLog);
    }

    /**
     * 删除定时任务执行记录对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteWxTimerLogByIds(String ids)
    {
        return wxTimerLogMapper.deleteWxTimerLogByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除定时任务执行记录信息
     * 
     * @param id 定时任务执行记录ID
     * @return 结果
     */
    @Override
    public int deleteWxTimerLogById(Integer id)
    {
        return wxTimerLogMapper.deleteWxTimerLogById(id);
    }
}
